<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% 
	String path = request.getContextPath();
%>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>未通过个人信息</title>

    <link rel="icon" type="<%= path %>/image/png" href="assets/images/favicon-32x32.png">
    <link rel="stylesheet" href="<%= path %>/assets/main/css/fonts.css">
    <link rel="stylesheet" href="<%= path %>/assets/main/css/style.css">
    <script src="<%=path %>/js/jquery-3.6.0.min.js" type="text/javascript"></script>
</head>
                   
                  <div class="row">
                        <div class="col-md-12">
                            <div class="card shadow">
                                <div class="card-body">
                                  
                                    <div class="table-responsive">
                                     
                                  
                                        <table id="example3" class="display nowrap">
                                         
                                            <thead>
                                                <tr>
                                                    <th>序号</th>
                                                    <th>标题</th>
                                                    <th>发布时间</th>
                                                    <th>状态</th>
                                                    <th>操作</th>
                                                    <th></th>
                                                    <th></th>
                                                </tr>
                                            </thead>
                                            
                                             <c:forEach items="${posts}" var="posts" varStatus="status">
                                            <tbody>
                                                <tr>
                                                    
                                                        
                                                    <td>${status.count }</td>
                                
                                        			<td><a href="<%=path %>/PostController?action=adoptshow&id=${posts.id }">                            
                                        			${posts.title }
                                        			</a></td>
                                                    <td>${posts.pubTime }</td>
                                                    
                                                    <td class="text-start">
                                                       <span class="badge badge-primary">
                                                        ${posts.ispass==false?"已通过审核":"未通过审核" }
                                                      </span>                                                                                                      
                                                      </td>
                                                     <td><button data-id="${posts.id }" class="delete">删除</button></td>
                                                     
                                               		 <td><a href="<%=path %>/PostController?action=edit&id=${posts.id}">修改</a></td>
                                               		 
                                                     </tr>
                                                </c:forEach> 
                                                
                                            </tbody>
                                           
                                        </table>
                                 
                                    </div>
                                    <c:forEach begin="1" var="i" end="${count/2+(count%2==0?0:1) }">
                                     <a  href="<%=path %>/PostController?action=Fail&pageNum=${i}">${i }</a>
                                    </c:forEach>
                                </div>
                            </div>
                        </div>
                    </div>
         

   

    <script src="<%= path %>/assets/plugins/popper/popper.min.js"></script>

    <script src="<%= path %>/assets/plugins/bootstrap/js/bootstrap.min.js"></script>

    <script src="<%= path %>/assets/plugins/moment/moment.min.js"></script>

    <script src="<%= path %>/assets/plugins/daterangepicker/daterangepicker.min.js"></script>

    <script src="<%= path %>/assets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<%= path %>/assets/js/init-tdatatable.js"></script>

    <script src="<%= path %>/assets/js/toggleFullScreen.js"></script>
    <script src="<%= path %>/assets/js/main.js"></script>


<script type="text/javascript">

        var path = "${pageContext.request.contextPath}";
		$(function(){
			$(".table-responsive").on("click",".delete",function(){
				//alert("1111111111");
				var id = $(this).data("id");
				var that = $(this);
				var url = path+"/PostController?action=delete";
				$.get(url,{id:id},function(mes){
					that.parent().parent().remove();
				});
			});
		})	
</script>
</body>

</html>